﻿var _func = window.onload
window.onload = function () {
    pop.init();
    pop.setFunction = function () {
        for (var i = 0, ci; ci = this.main.childNodes[0]; i++) {
            if (ci.tagName == "DIV" && ci.className == "contentDiv") {
                this.main.removeChild(ci);
                break;
            }
        }
        var idn = arguments[2];
        if (!idn) { return; }
        if (singlePerson.prototype.collection[idn]) {
            var item = singlePerson.prototype.collection[idn];
            this.main.appendChild(item.UI.frame);
            item.clickHandler = function () {
                pop.spInterface.Succeeded = function () {
                    item.insertComment(item.UI.newComment.value, "I", new Date());
                }
                pop.spInterface.SaveNewMessage(item.UI.newComment.value, item.user, item.identity.replace("v-","\\v-"));
            }
        }
    }
    if (_func) { _func.apply(); }
}